MP3Gain

version 1.2.4

Copyright © 2001-2004 by Glen Sawyer


Introduction

MP3Gain analyzes mp3 files to determine how loud they sound to the human ear. It can then adjust the mp3 files so that they all have the same loudness without any quality loss. This way, you don't have to keep reaching for the volume dial on your mp3 player every time it switches to a new song.

MP3Gain operates in two modes, Track and Album:

  • Track mode volume-corrects a mix of unrelated songs to a selected level. MP3Gain calculates the volume level for each song individually. It then corrects each song to make its volume level match the Target Volume.
    For example, if you have 3 songs that have volume levels of 86, 91 and 89 dB and you use Track Gain to convert them to a Target Volume of 92 dB, they will all be at approximately 92 dB.

  • Album mode volume-corrects a collection of related songs (as they would appear on a CD, or "album") relative to other collections of songs. Applying Album gain is like adjusting the volume knob once for each CD you put in your CD player. The overall volume of the album is adjusted to the Target Volume, but the volume differences between the mp3s in the album are preserved.
    For example, if you have 3 songs that have volume levels of 86, 91 and 89 dB, then the overall volume of this "album" will probably be around 89 dB. If the Target Volume is set to 92 dB, then when you apply Album Gain MP3Gain will increase the volume of each of these songs by +3 dB.

    With Album mode, you want some songs to be noticeably quieter than other songs, just like they are on an album. If you're playing a classical CD, you expect the track with the flute solo to be quieter than the track with the big full-orchestra finale. Album mode allows you to correct an entire album while keeping each song's volume level relative to the other songs.

MP3Gain can also make changes based on the peak amplitude of the mp3, ignoring how loud the mp3 actually sounds to the human ear.
This peak adjustment is what most audio programs mean by "normalizing". To differentiate between "peak" normalizing and "loudness" normalizing, I use the term "maximizing" when talking about peak normalizing.
Maximizing can be used to make an mp3 as loud as possible without clipping. This can be useful, but keep in mind that this will not make your mp3s the same volume. In fact, if you maximize every track on a CD, some of the original quiet tracks can become louder than the original loud tracks.

David Robinson has made a graph that illustrates these different modes of operation, and what their effects might be on tracks from different types of CDs:

MP3Gain is completely freeware. No registration, no time limits, no disabled features, no annoying pop-up messages, or anything like that.
There will always only be one current version of MP3Gain, and that version will always be freely available to everyone.

With that said, if you really like this program and feel like making a donation to the author, you can find the appropriate information by clicking Help > About in the menu of the program itself.


Concepts

Peak Normalization

Most programs that "normalize" sound files do so by adjusting all the samples so that the loudest single sample is at some specified value. This is not a good way to make all the files actually have the same loudness. First of all, the human ear does not hear the loudness of single samples. It averages out sounds over time. Secondly, today's popular music CDs are heavily compressed. The sound engineers making the CD raise the average level so that it sounds much louder, while compressing the loudest parts so that they don't distort. A typical uncompressed sound file might look like this:

A typical compressed sound file might look like this:

Both of these files have a peak sample at about 100%, but the compressed file has a much louder average level. It sounds much louder when played back. So to do actual loudness normalization instead of peak normalization, we need to calculate how loud the file actually sounds. MP3Gain uses the Replay Gain algorithm to calculate this loudness.

Lossless Gain Adjustment

The bad news: MP3Gain can only adjust the volume of your mp3 files in steps of 1.5 dB.

The good news: 1.5 dB is a small enough step for most practical purposes. Most humans can just barely hear a volume change of 1 dB.

The other good news is that this volume adjustment is completely lossless. In other words, if you adjust an mp3 by -6 dB and then change your mind, you can adjust it again by +6 dB and it will be exactly the same as it was before you made the first adjustment.

Here's the technical reason why it's lossless, and also why the smallest change possible is 1.5 dB:

The mp3 format stores the sound information in small chunks called "frames". Each frame represents a fraction of a second of sound. In each frame there is a "global gain" field. This field is an 8-bit integer (so its value can be a whole number from 0 to 255).

When an mp3 player decodes the sound in the frame, it uses the global gain field to multiply the decoded sound samples by 2(gain / 4).

So if you add 1 to this gain field in all the frames in the mp3, you effectively multiply the amplitude of the whole file by 2(1/4) = 119% = +1.5 dB.

Likewise, if you subtract 1 from the global gain, you multiply the amplitude by 2(-1/4) = 84% = -1.5 dB.


MP3Gain Interface

The MP3Gain Interface has 5 sections:


Menus

MP3Gain has the following menu items available:

File
Analysis
Modify Gain
Options
Language
Help


File menu

The File menu has the following items

Load Analysis Results | This loads previously saved MP3Gain analysis results.
Save Analysis Results | This saves all analysis results (Volume, Track Gain, Album Gain, etc.) currently shown in the File List.
Add Files (Ctrl-F) | This allows you to add files to be corrected. Added files appear in the File List.
Add Folder (Ctrl-D) | This allows you to add an entire folder instead of having to manually select all the mp3 files in a folder. Added folders appear in the File List.
Select All Files (Ctrl-A) | This selects every file in the File List.
Select No Files (Ctrl-N) | This unselects every file in the File List.
Invert selection (Ctrl-V) | This inverts or toggles the selection status of every file in the File List. If a file is selected, it becomes unselected. If a file is unselected, it becomes selected.
Clear selected file(s) | This will remove all selected files from the File List.
Clear All files | This will remove all files from the File List.
Exit | This quits MP3Gain.


Analysis menu

The Analysis menu has the following items, which are also available by right-clicking in the file list (note):

Track Analysis (Ctrl-T) | This will analyze each file individually and then list details of the file. See the File List section for information about the columns.
Album Analysis (Ctrl-U) | This will analyze each file in the Album as part of a whole and then list details about the files. See the File List section for information about the columns.
Max No-clip Analysis (Ctrl-M) | (Only visible when Maximizing features are enabled) If you are only interested in maximizing the volumes of your files, this will find the peak amplitudes of each of the mp3s in the list without spending any extra time doing Replay Gain calculations to determine how loud the file actually sounds to the human ear.
Clear Analysis | This will clear the analysis results in the File List. The files will remain in the list, but will have their column info deleted.

(note) - When you use the right-click popup menu, MP3Gain will only perform the chosen function on files that are currently selected in the File List.


Modify Gain menu

The Modify Gain menu has the following items, which are also available by right-clicking in the file list (note):

Apply Track Gain (Ctrl-G) | This will volume-correct all files listed in the File List to match the Target Volume.
Apply Album Gain (Ctrl-B) | This will volume-correct all files listed in the File List so that the overall album volume matches the Target Volume.
Apply Constant Gain... (Ctrl-O) This will launch the Constant Gain dialog.

Here you can specify an absolute gain change in dB instead of a Target Volume. Just move the slider until the dB field indicates the amount of gain desired. Increments are in 1.5 dB.

You can also apply gain to just the right or left channel if the mp3 is stereo or dual-channel. Check the Apply to only one channel box and then choose which channel by clicking the radio button beside the desired channel.

Apply Max No-clip Gain for Each file (Ctrl-X) (Only visible when Maximizing features are enabled)
This will change the gain on each mp3 file so that it is as loud as possible without clipping.

NOTE - This is not a good way to make all your mp3s the same volume. Different mp3s can have very different ratios between their maximum amplitude and their average amplitude.
But if you don't care about volume differences between your mp3s and just want them each to be as loud as possible, then this is the function to use.

Apply Max No-clip Gain for Album (Ctrl-L) (Only visible when Maximizing features are enabled)
This will look at each folder in the file list, find the single maximum gain which will not cause any clipping in any of the mp3s in the folder, and then apply that single gain change to all the mp3s in the folder.

I use this feature myself when burning mix CDs of my mp3s. I copy all the mp3s that will be on the CD into one folder, do Track Gain on the folder, and then use this function on the folder. This way, the mp3s are all the same volume, but the whole CD will be as loud as possible without any of the mp3s clipping.

Undo Gain changes | If tags are enabled (i.e. "Options - Tags - Ignore" is not checked), then selecting this menu option will undo all gain changes to the mp3 files in the list

(note) - When you use the right-click popup menu, MP3Gain will only perform the chosen function on files that are currently selected in the File List.


Options menu

The Options menu has the following items:
Always on Top | If this option is checked, the MP3Gain window will always stay on top of other windows.
Work on Selected files only | If this option is checked, then only those files that are currently selected will be operated on if you do an Analysis or Gain.
Add Subfolders | If checked, then when you Add a Folder, all of the mp3s in all of the folders inside the selected folder will be added to the list.
Preserve file date/time | If checked, changed files will keep their original timestamp. If unchecked, file timestamps will change when Gain changes are applied.
No check for Layer I or II MP3Gain will only work on mp3 files. On rare occasions, MP3Gain will mis-identify an mp3 file as an mp2 or mp1 file and refuse to do analysis or gain changes on the file.
Enabling this option forces mp3Gain to skip the safety check, allowing you to change the gain on these mis-identified files.

Be careful, though; if you have any mp2 or mp1 files that are accidentally mis-named as mp3 files, then when you use MP3Gain to make gain chages on those files, the program will just corrupt the data in those files.

Don't clip when doing Track Gain | If this is checked, then when you do "Track Gain", if the suggested Track gain will cause clipping then MP3Gain will apply the maximum non-clipping gain instead
Tags | See the Tags help page
Logs... You can have MP3Gain record its operations to various logfiles. Selecting this item will launch the Logs window:

You can specify the directory and filename for log files that will collect all errors, analysis results and changes made.

Toolbar You can modify the look of the toolbar with this item. Available options for the toolbar are:

Big Buttons
Small Buttons
Text Buttons
No Buttons

Filename Display You can select how files are displayed in the File List. By default, files are shown with their full path and filename. Available options for the filename display are:

Show Path/File
Show File only
Show Path & File (as separate columns)

Minimize to Tray If this option is checked, then when you minimize the MP3Gain window it will appear as an icon in the system tray notification area (the little rectangle in the bottom right corner of your screen) instead of appearing on your taskbar.
Useful for keeping your taskbar clean while MP3Gain is working in the background.
Beep when finished | If checked, then MP3Gain will make a default beep sound when it finishes a task.
Reset Default Column Widths | This option will reset the column positions & sizes to their default settings. Use this if you accidentally hide a column under another, or off the screen.
Reset "Warning" messages The first time you perform some actions in MP3Gain (Clear Analysis, for example), the program pops up a dialog box with a warning message. On this dialog box, there's a check box that says Don't ask me again. If you check that box, the program stops showing that particular warning message.

Clicking Reset "Warning" Messages makes those warning messages start popping up again.

Advanced... Advanced options allows you to modify Thread Priority and Performance variables, and allows you to turn on "maximizing" features.

Thread Priority | This adjusts what priority the program has in using your computer's resources. If you know what this means, feel free to play with this setting. If you don't know what this means, just leave it alone :)
Performance | Checking these boxes might make MP3Gain run slightly faster on your machine. Unfortunately, it also might make your computer freeze up when you apply Gain changes. If that happens, just reboot, start MP3Gain again, and un-check the box you checked.
Enable "Maximizing" features | "Maximizing" is the word I use to describe what most audio programs call "normalizing": finding the maximum amplitude of sound files and setting them to a specified level. This is not a good way to make audio files sound like they're the same volume. It was my experience with a "normalizing" program that made me write MP3Gain. When you check this box, a message pops up with a link to some files that demonstrate the volume differences that can remain between songs when you maximize the amplitudes of audio files instead of volume normalizing.


Language menu

If one or more language translation files are in the MP3Gain folder, then this menu will allow you to switch between these translations and the original U.S. English.


Help menu

The Help menu has the following items:

Contents | This launches this help file.
Disclaimer | This is a standard software disclaimer that indicates that the author of MP3Gain is not liable for any damages to anyone or anything, anywhere, for any reason, forever :)
About | This gives you information, such as the current version of the interface and backend, contact information for the author and newer versions of MP3Gain, and methods of supporting the author with a donation.


Button Bar

Note that the Analysis buttons (Track/Album) and Gain buttons (Track/Album/Constant) are switchable by using the small arrow to the immediate right of the button. For example, if the Track Gain button is visible, you can choose either the Album Gain or Constant Gain buttons by clicking on the arrow and making your selection.

The Button Bar has the following icons:

Add File(s) | This will bring up a File browse dialog that lets you navigate to a folder and then add one or more files from that folder to the File List.
Add Folder | This will bring up a Directory browser that lets you navigate to a folder and then select it. All files in that folder will be added to the File List. If Add Subfolders is checked under Options, then all folders under the selected one will also be selected and their files added to the File List.
Track Analysis | This will analyze each file in the File List and calculate the file's volume level.
Album Analysis | This will analyze each file in the File List as part of an album and calculate the total album volume level.
Track Gain | This will correct all files in the File List using the Target Volume in Track mode.
Album Gain | This will correct all files in the File List using the Target Volume in Album mode.
Constant Gain | This will adjust all files in the File List using the dB value indicated by the slider in the Constant Gain Change dialog.
Clear Files | This will remove selected files from the File List.
Clear All | This will remove all files from the File List.


Target Volume

The Target "Normal" Volume is the average volume you want each of your mp3 files (in Track mode) or each of your mp3 collections (in Album mode) to have.

The default is 89.0 dB because most mp3s will not have clipping at this volume level.
("Clipping" means that when the mp3 file is decoded by your player, some of the sound samples will be too loud. The player will "clip" these samples so that they do not exceed the maximum allowable value. This clipping creates a sort of rough, "scratchy" sound during loud parts of the song.)
If most of your mp3s are from very modern CDs, then you might be able to push the Target Volume up higher without introducing clipping into your files.


File List

The File List shows you all files that have been added for processing. If a file name is colored RED, then one or more of the following conditions is true:
  • The file is currently clipping (indicated by a "Y" in the "clipping" column).
  • The file will have clipping if you apply Track Gain (indicated by a "Y" in the "clip(Track)" column)
  • The file will have clipping if you apply Album Gain (indicated by a "Y" in the "clip(Album)" column)

Here is what each of the columns in the file list means:
Volume | The current volume of the mp3, in dB SPL. If you play back the mp3 in a calibrated system, it will have this average sound pressure level in decibels.
clipping | This column has a Y if the mp3 file is currently clipping. “Clipping” means that when the mp3 file is decoded by your player, some of the sound samples will be too loud. The player will “clip” these samples so that they do not exceed the maximum allowable value. This clipping creates a sort of rough, “scratchy” sound during loud parts of the song.
Track Gain | The dB change that should be applied to this mp3 so that its average volume is as close to the target volume as possible.
clip (Track) | This column has a Y if the mp3 will clip if the suggested Track Gain is applied.
Max Noclip Gain | (Only visible when Maximizing features are enabled) Shows the maximum gain change that can be applied to this file without any clipping
Album Volume | The current overall volume of the Album.
Album Gain | The dB change that should be applied to all the mp3s in the Album so that the overall volume is as close to the target volume as possible.
clip (Album) | This column has a Y if the mp3 will clip if the suggested Album Gain is applied.

NOTE: - The Track Gain and Album Gain columns are rounded to the nearest 1.5 dB change. The lossless method MP3Gain uses to modify mp3 files is limited to 1.5 dB as the smallest possible volume change.

If there is a ??? in the clipping column for a file, then the mp3 probably has some bad data in it. This bad data could have been caused by a download error, a poor job of splicing two mp3s into one, or other factors. Listen closely to the mp3, and somewhere you'll probably be able to hear a loud click, pop, “chk”, or other sound. Because of this bad data, the program cannot accurately determine the maximum amplitude, because the bad data is causing extreme clipping.
Fortunately, in most cases the amount of bad data is small enough that it does not affect the calculation of the overall volume of the file. The suggested Track and Album gains are probably still valid.


Status

The two Status bars and the Status line at the bottom of the MP3Gain interface are designed to give you an idea about what MP3Gain is currently doing and how far along a file or batch is during Analysis or Gain operations.

If a single file is being worked on, only the File progress bar will be updated. The Status line will show what MP3Gain is currently doing.

If several files are being worked on, then both the File progress and Total progress bars will be updated. The Status line will show what MP3Gain is currently doing. In the example below, the current file is 25% finished, while the entire batch of files being processed is 50% finished.


Tags

MP3Gain can store "Analysis" and "Undo" information in special tags inside the mp3 file itself. If tag writing is turned on, then MP3Gain only has to spend time analyzing an mp3 file once. If you load the same file into MP3Gain at a later time, then the program will see the tag and instantly display the volume and recommended gain changes for the mp3.
With the tag information, MP3Gain is also able to automatically undo any changes you make to an mp3 file. All you have to do is load the mp3 file into MP3Gain and select "Modify Gain - Undo Gain changes" from the menu.

Here are the options in the "Options - Tags" submenu:

  • Ignore (do not read or write tags): Completely turns off all tag features.
  • Re-calculate (do not read tags): Forces MP3Gain to re-analyze an mp3 even if it already has MP3Gain tags in it.
  • Don't check while adding files: By default, MP3Gain checks each mp3 as it is added to the list to see if it has tag information. If you select this option, however, MP3Gain skips that test while adding files to the list. This can speed up the process if you're adding a large folder of mp3s to MP3Gain.
  • Remove Tags from files: Deletes all MP3Gain tags from any mp3 files in the list. This should only be necessary if your mp3 player is having problems with the MP3Gain tags.


How Do I...?

Make each of my mp3s have the same volume

Make each of my folders of mp3s have the same overall volume


Make every mp3 the same volume

This is what MP3Gain was originally created for; to make several different mp3s all the same volume.

Step 1 | Click the Add File(s) button
Step 2 | Navigate to where the files you want to convert are and select them, then click Open. This will add them to the File List. You can then add more files until all the files that you want to work with are in the File List.
Step 3 | Set your Target Volume in Decibels (dB) in the Target "Normal" Volume field, or leave it at the default of 89.0.
Step 4 | Click the Track Analysis button MP3Gain will analyze the files and report on their current volume level as well as the change required to meet the target volume. Make note of the mp3's original volume level (the value under the Volume column) if you want to modify the volume setting back to its original value.
Step 5 | Click the Track Gain button This will modify the files with the volume settings you chose for Target "Normal" Volume.
Step 6 | Listen to your new mp3s. If they sound too loud or quiet, adjust the Target Volume setting and click Track Gain again.


Make each mp3 folder have the same average volume

Here are the steps to follow if you have folders of mp3s, and
A) you want to make each whole folder have a chosen overall volume, but
B) you want the volume differences between the individual mp3s inside each folder to remain the same.

(MP3Gain automatically assumes that mp3s in different folders are in different "albums")

Step 1 | Click the Add Folder button
Step 2 | Navigate to where the folder that you want to convert is and select it Repeat as needed if you have more than one folder you want to normalize
Step 3 | Set your Target Volume in Decibels (dB) in the Target "Normal" Volume field.
Step 4 | Click the Album Analysis button MP3Gain will analyze all of the files and report on each song's volume level, whether any clipping occurred, and other details including the combined album volume levels. If you are not using tags, then make note of the mp3's original volume level (the value under the Volume column) if you want to modify the volume setting back to its original value. You can also check the Analysis log if you have it enabled for these details.
Step 5 | Click the Album Gain button This will adjust all the mp3s in the album so that the overall volume of each album is as close to the Target "Normal" Volume as possible. The volume differences between the mp3s on the album will stay the same.
Step 6 | Listen to your new mp3s. If they sound too loud or quiet, adjust the Target Volume setting and click Album Gain again.

NOTE: You can skip step 4 if you don't care what the original album volume was. If you press the Album Gain button before analysis has been done, it will automatically do analysis first. (Otherwise, how would it know what gain adjustment to make?)


Troubleshooting

  • My screen is going completely black while MP3Gain is working
  • My tags ("Artist", "Title", etc.) are not displaying correctly after using MP3Gain


Black Screen

My screen is turning black

If your screen goes completely black for a second when you start MP3Gain and again goes black whenever you do any analysis or gain changes, then your DOS settings need to be adjusted on your computer. Here's what you do:
  1. Start MP3Gain
  2. Make sure that "Options - Tags - Ignore tags" is checked. This is just to make sure that the analysis will take longer
  3. Add a large folder full of big mp3s. Again, this is just so that the analysis will take a long time
  4. Do "Album Analysis"
  5. While your screen is black, press and hold the "Alt" key, and press the "Enter" key. This should make the DOS screen shrink from full-screen to a normal window
  6. Use your mouse to right-click in the title bar of the DOS window
  7. In the pop-up menu that appears, select "Properties"
  8. Somewhere in the Properties window that appears, there will be an option to select either "Full screen" or "Window" (the exact place in the Properties window varies between Windows 95/98/ME/NT/2000/XP)
  9. Make sure "Window" is selected, and then press the "OK" button
  10. Windows should then give you a choice; either "Apply properties to current window only" or "Save properties for future windows with same title". Choose the "Save properties..." option
  11. If you checked the "Ignore tags" option in step 2, then don't forget to un-check it again


Tag Problems

My tags ("Artist", "Title", etc.) are not working after using MP3Gain

MP3Gain stores "Analysis" and "Undo" information in special tags inside the mp3 file itself. These tags are in the APEv2 format. APEv2 tags are carefully designed to not interfere with other tag formats, such as the popular ID3v1 format.

Unfortunately, some mp3 players do not strictly adhere to the ID3v1 standard when reading tags. As a result, when MP3Gain writes its APEv2 tags, these mp3 players might get confused and try to read the MP3Gain tags instead of the regular ID3v1 tags such as "Artist", "Title", etc. As a result, the player will show random garbage in these fields.

(To be fair, the mp3 players that have this problem are actually probably trying to compensate for data corruption that can occur in mp3s due to bad encoders, incomplete downloads, etc.)

If you use MP3Gain and discover that your mp3 player has this problem, then here's what you need to do:

  • Select "Options - Tags - Ignore (do not read or write tags)" from the MP3Gain menu. This will prevent MP3Gain from writing any more tags to your files.
  • To remove tags that MP3Gain has already written, simply load the affected mp3s into MP3Gain and do "Options - Tags - Remove Tags from files"

IMPORTANT
If you choose the "Options - Tags - Ignore" option, then you will not be able to automatically undo changes made by MP3Gain. You will still be able to undo any changes, but you will have to manually keep track of what changes you make to your files.


Credits

MP3Gain written by Glen Sawyer

ReplayGain idea, concepts & website by David Robinson

Control buttons by Marc Heubeck

Help file by Bill MacEachern

The latest version of MP3Gain can be found at http://mp3gain.sourceforge.net/

For more information about ReplayGain analysis, please see the ReplayGain website at http://replaygain.hydrogenaudio.org/

MP3Gain is completely freeware. No registration, no time limits, no disabled features, no annoying pop-up messages, or anything like that. There will always only be one current version of MP3Gain, and that version will always be freely available to everyone.
With that said, if you really like this program and feel like making a donation to the author, you can find the appropriate information by clicking Help > About in the menu of the program itself.